<?php
class indexControl extends commonControl {
	//显示首页
    function index(){
    	C('DEBUG',0);
        $this->display();
    }
    //显示欢迎界面
    public function welcome(){
    	p($_SESSION);
    	$uploadsize = ini_get("upload_max_filesize"); //允许上传的单个文件最大值
    	$gd = gd_info(); //获得GD库所有信息
    	$gdversion = $gd['GD Version']; //获得GD库版本
    	$diskspace = get_size(disk_free_space('.'));
    	$system = array(
    			"phpversion" => PHP_VERSION,
    			"phpos" => PHP_OS,
    			"uploadsize" => $uploadsize,
    			"gdversion" => $gdversion,
    			"diskspace" => $diskspace
    	);
    	$db = M();
    	$system['mysqlversion'] = $db->get_version();
    	$this->assign('system', $system);	
    	$this->display();   	
    }
    //设置后台风格样式
    public function set_style(){
    	$uid = $_SESSION['user'];
    	if(empty($_POST['style']))return;
		$db = M('user');
		if($db->where('uid='.$uid)->save()){
			session::set('style', $_POST['style']);
			
		}
	   	
    }
}